package com.audi.dto;

import java.util.ArrayList;

import org.json.JSONException;
import org.json.JSONObject;

import android.util.Log;

public class DeviceTimeAlarmItem {
    String hourAlarm;
    String minuteAlarm;
    ArrayList<String> dayAlarm;
    int everydayAlarm = 0;
    int everyhourAlarm = 0;
    
    public DeviceTimeAlarmItem(String hourAlarm, String minuteAlarm,
            ArrayList<String> dayAlarm, int everydayAlarm, int everyhourAlarm) {
        super();
        this.hourAlarm = hourAlarm;
        this.minuteAlarm = minuteAlarm;
        this.dayAlarm = dayAlarm;
        this.everydayAlarm = everydayAlarm;
        this.everyhourAlarm = everyhourAlarm;
    }
    
    public String getHourAlarm() {
        return hourAlarm;
    }
    
    public void setHourAlarm(String hourAlarm) {
        this.hourAlarm = hourAlarm;
    }
    
    public String getMinuteAlarm() {
        return minuteAlarm;
    }
    
    public void setMinuteAlarm(String minuteAlarm) {
        this.minuteAlarm = minuteAlarm;
    }
    
    public int getEveryhourAlarm() {
        return everyhourAlarm;
    }
    
    public void setEveryhourAlarm(int everyhourAlarm) {
        this.everyhourAlarm = everyhourAlarm;
    }
    
    public ArrayList<String> getDayAlarm() {
        return dayAlarm;
    }
    
    public void setDayAlarm(ArrayList<String> dayAlarm) {
        this.dayAlarm = dayAlarm;
    }
    
    public int getEverydayAlarm() {
        return everydayAlarm;
    }
    
    public void setEverydayAlarm(int everydayAlarm) {
        this.everydayAlarm = everydayAlarm;
    }
    
    public JSONObject getAlarmjson(DeviceTimeAlarmItem alarmItem)
            throws JSONException {
        JSONObject alarmObj = new JSONObject();
        try {
            alarmObj.put("hour", alarmItem.getEveryhourAlarm());
            alarmObj.put("minute", alarmItem.getMinuteAlarm());
            alarmObj.put("day", alarmItem.getDayAlarm());
            alarmObj.put("everyday", alarmItem.getEverydayAlarm());
            alarmObj.put("everyhour", alarmItem.getEveryhourAlarm());
        } catch (Exception e) {
            Log.e("==error put ========", e + "==========");
            return null;
        }
        return alarmObj;
        
    }
    
}
